﻿namespace PrearrangedChaos.AgileZen.Service
{
    public class ZenFilter
    {
        private readonly string _filterValue;

        internal ZenFilter(string filterValue)
        {
            _filterValue = filterValue;
        }

        internal string GetExpression()
        {
            return this._filterValue;
        }

        public static ZenFilter operator &(ZenFilter filter1, ZenFilter filter2)
        {
            return new ZenFilter(string.Format("({0} and {1})", filter1.GetExpression(), filter2.GetExpression()));
        }

        public static ZenFilter operator |(ZenFilter filter1, ZenFilter filter2)
        {
            return new ZenFilter(string.Format("({0} or {1})", filter1.GetExpression(), filter2.GetExpression()));
        }
    }
}